/**
 * Created by Administrator on 2017/1/21.
 */

var MJ = require('../MJ/MJ');

var ScoreRule = clone(MJ.ScoreRule);


var Pattern = {
    'NONE': 0,                // 不是可胡的牌型
    'NORMAL': MJ.Pattern.NORMAL,                // 平胡
    'ZHAGANG': 5                // 扎胡
};

var PatternScore = {}
PatternScore[Pattern.BT] = 0;
PatternScore[Pattern.NORMAL] = 1;
PatternScore[Pattern.ZHAGANG] = 3;


var ItemScore = {};
ItemScore[ScoreRule.ZM] = 1;
ItemScore[ScoreRule.GSH] = 2;
ItemScore[ScoreRule.QG] = 3;


var ScoreReason = {
    DH: MJ.Result.DH,  // 点胡/点炮
    ZM: MJ.Result.ZM,  // 自摸/被自摸

    BT: ScoreRule.BT, // 报听
    LZ: ScoreRule.LZ, // 庄家
    QG: ScoreRule.QG, // 抢杠
};

var GangScore = {};
GangScore[MJ.Gang.BA] = 1;
GangScore[MJ.Gang.AN] = 2;
GangScore[MJ.Gang.DIAN] = 1;
GangScore[MJ.Gang.ANS] = 2;

exports.ScoreRule = ScoreRule;
exports.Pattern = Pattern;
exports.PatternScore = PatternScore;
exports.ItemScore = ItemScore;
exports.ScoreReason = ScoreReason;
exports.GangScore = GangScore;
